package com.lyf.baoxian.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.lyf.baoxian.R;
import com.lyf.baoxian.activity.BaodanActivity;
import com.lyf.baoxian.activity.SelectActivity;
import com.lyf.baoxian.utils.MyMethod;

import butterknife.Bind;

/**
 * Created by 刘亚飞 on 2017/1/8.
 */

public class BaoDanFragment extends BaseFragment implements View.OnClickListener {
    @Bind(R.id.bt_search)
    Button bt_search;

    @Bind(R.id.dateSelect)
    TextView dateSelect;

    @Bind(R.id.rl_select)
    RelativeLayout rl_select;

    @Override
    protected void afterCreate(Bundle savedInstanceState) {
        bt_search.setOnClickListener(this);
        dateSelect.setOnClickListener(this);
        rl_select.setOnClickListener(this);
    }

    @Override
    protected View addLayout(LayoutInflater inflater) {
        View view = inflater.inflate(R.layout.fragment_baodan,null);
        return view;
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.dateSelect:
                MyMethod.showDateDiaog(mActivity,dateSelect);
                break;

            case R.id.bt_search:
                Intent intent = new Intent(mActivity, BaodanActivity.class);
                mActivity.startActivity(intent);
                break;

            case R.id.rl_select:
                Intent intent1 = new Intent(mActivity, SelectActivity.class);
                mActivity.startActivity(intent1);
                break;
        }

    }
}
